import App from './App'
import uviewPlus from '@/uni_modules/uview-plus'
import * as Pinia from 'pinia';

// #ifdef VUE3
import {createSSRApp} from 'vue'
import './uni.promisify.adaptor'
import authorize from "@/utils/authorize";

// const BASE_UPLOAD = 'http://localhost:8080/file/minio_upload'  //开发环境上传地址
const BASE_UPLOAD = 'https://www.douluodalu.icu/minio_upload'  //线上环境上传地址
// const CHAT_URL = 'ws://127.0.0.1:9204';
const  CHAT_URL = 'https://www.douluodalu.icu';

// const  CHAT_URL = 'wss://www.douluodalu.icu:9204';

const DEFAULT_BG = 'https://www.douluodalu.icu:9000/school/static/bg.jpg';
const NOT_SHOW_BIRTH = '1899-12-31';
const NOT_SHOW_SEX = 3;


//授权方法全局挂载
export function createApp() {
    const app = createSSRApp(App)
    app.config.globalProperties.$authorize = authorize
    app.config.globalProperties.$BASE_UPLOAD = BASE_UPLOAD
    app.config.globalProperties.$CHAT_URL = CHAT_URL
    app.config.globalProperties.$DEFAULT_BG = DEFAULT_BG
    app.config.globalProperties.$NOT_SHOW_BIRTH = NOT_SHOW_BIRTH
    app.use(uviewPlus)
    app.use(Pinia.createPinia());
    return {
        app,
        Pinia
    }
}

// #endif
